package com.hr.牛客网剑指offer;

/**
 * @author zhz
 * @date 2020/08/20
 **/
public class JZ2_替换空格 {
    public static String replaceSpace(StringBuffer str) {
        String str1=str.toString();
        return str1.replaceAll(" ","%20");
    }

    public static void main(String[] args) {
        System.out.println(JZ2_替换空格.replaceSpace(new StringBuffer("We Are Happy.")));
    }
}
